package com.hdl.design.pattern.factory.method;

/**
 * 类名 OperationDiv
 * 描述 除法操作实现
 *
 * @author hedonglin
 * @version 1.0
 * @date 2019/9/25 9:48
 */
public class OperationDiv extends AbstractOperation {

    @Override
    public double getResult() {
        if (numberRight == 0){
            System.out.println("分母不能为0");
            return 0;
        }
        return numberLeft / numberRight;
    }
}
